package book;

public class BookList {
    private Book[] books =new Book[10];
    private int num;//计算书架有多少本书
    public BookList() {
        this.books[0]=new Book("三国演义","罗贯中",19,"小说");
        this.books[1]=new Book("西游记","吴承恩",35,"小说");
        this.books[2]=new Book("红楼梦","曹雪芹",45,"小说");

        num=3;
    }
    public Book getBook(int i) {
        return books[i];
    }

    public void setBooks(int pos,Book book) {
        this.books[pos] = book;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num += num;
    }
}
